<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        .box {
            width: 100px;
            height: 50px;
            border: solid #000;
            margin: 100px auto;
            overflow: hidden;
        }

        @keyframes banner {
            from {
                transform: translateX(0px);
            }

            5% {
                transform: translateX(0px);
            }

            48% {
                transform: translateX(-100px);
            }

            52% {
                transform: translateX(-100px);
            }

            95% {
                transform: translateX(-200px);
            }

            to {
                transform: translateX(-200px);
            }

        }

        ul {
            position: relative;
            animation: banner 3s linear infinite alternate;
        }

        li {
            width: 100px;
            text-align: center;
            line-height: 50px;
            position: absolute;
            top: 0;
        }

        li:first-child {
            background-color: red;
            left: 0;
        }

        li:nth-child(2) {
            background-color: blue;
            left: 100px;
        }

        li:last-child {
            background-color: green;
            left: 200px;
        }
    </style>
</head>

<body>
    <div class="box">
        <ul>
            <li>red</li>
            <li>blue</li>
            <li>green</li>
        </ul>
    </div>
</body>

</html>